package com.green.dao.manage.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.green.common.page.Pagination;
import com.green.dao.impl.BaseDaoImpl;
import com.green.dao.manage.PositionDao;
import com.green.model.manage.Position;



/**
 * 人员
 * 
 */
@Repository("positionDao")
public class PositionDaoImpl extends BaseDaoImpl implements PositionDao {

	@Override
	public int insertPosition(Position ct) {
		return insert("com.green.dao.manage.PositionDao.insertPosition", ct);
	}

	@Override
	public int updatePosition(Position ct) {
		return update("com.green.dao.manage.PositionDao.updatePosition", ct);
	}

	@Override
	public int deletePosition(Map<String, Object> param) {
		return delete("com.green.dao.manage.PositionDao.deletePosition", param);
	}

	@Override
	public Position getPositionById(String id) {
		return (Position) super.getSqlSession().selectOne("com.green.dao.manage.PositionDao.getPositionById",id);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Position> getPositionList(Map<String, Object> param) {
		return (List<Position>) this.selectList("com.green.dao.manage.PositionDao.getPositionList", param);
	}

	@Override
	public Pagination<Position> getPositionPagination(Pagination<Position> pag,
			Map<String, Object> param) {
		return selectList("com.green.dao.manage.PositionDao.getPositionList", param, pag);
	}
	
	
}
